//
//  BaseView.m
//  KuaiTu
//
//  Created by 江伟 on 2018/10/24.
//  Copyright © 2018年 WeiJiang. All rights reserved.
//

#import "BaseView.h"

@implementation BaseView
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
        [self setupSimulatData];
    }
    return self;
}
- (void)setupViews {}
- (void)setupSimulatData {}
- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupViews];
    [self setupSimulatData];
}

- (UIViewController *)currentVC {
    UIView *next = self.superview;
    while (1) {
        UIResponder *nextResponder = next.nextResponder;
        if ([nextResponder isKindOfClass:[UIViewController class]]) {
            return (UIViewController *)nextResponder;
        }
        next = next.superview;
    }
    return nil;
}
@end
